package com.xw.bo.ks.client;

import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;
import com.dtflys.forest.annotation.Var;

import java.util.Map;

/**
*
* @author： XW -> ~
* @create： 2023/11/7 18:01
*/
//@Component
public interface WechatClient {

    /**
     * 微信通知
     * @param key 加密信息，包含查询快递的订单号
     */
    @Post(
            url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={key}",
            headers = {
                    "Accept-Charset: utf-8",
                    "Content-Type: application/json"
            },
            dataType = "json")
    void sendWechatMsg(@Var("key") String key, @JSONBody Map<String, Object> body);

    /**
     * 本地获取线上的token
     * @param companyId 公司id
     */
//    @Get(
//            url = "http://47.100.60.197/kuaishou/noAuth/printToken?companyId={companyId}",
//            headers = {
//                    "Accept-Charset: utf-8",
//                    "Content-Type: application/json"
//            },
//            dataType = "json")
//    JsonResult<KsAccessTokenResponse> sendProdToken(@Var("companyId") String companyId);


    @Get(
            url = "https://app.kwaixiaodian.com/merchant/shop/detail?id={id}",
            headers = {
                    "Accept-Charset: utf-8",
                    "Content-Type: application/json"
            },
            dataType = "json")
    String ksMerchantShop(@Var("id") String id);


    /**
     * 快递信息
     * @param v 加密信息，包含查询快递的订单号
     * @return
     */
    @Get(
            url = "{url}",
            headers = {
                    "Accept-Charset: utf-8",
                    "Content-Type: application/json",
                    "v: {v}"
            },
            dataType = "json")
    String expressInfo(@Var("url")String url, @Var("v") String v);

    @Get(
            url = "{url}",
            headers = {
                    "Accept-Charset: utf-8",
                    "Ds-Sign: ${dsSign}",
                    "Ds-User-Id: ${dsUserId}",
                    "Ds-Time: ${dsTime}",
                    "Ds-Token: ${dsToken}"})
    String orderInfo(@Var("url")String url,
                     @Var("dsSign") String dsSign,
                     @Var("dsUserId") Integer dsUserId,
                     @Var("dsTime") Integer dsTime,
                     @Var("dsToken") String dsToken);




}
